﻿using DevExpress.XtraGrid.Demos.util;
using Luna小店.DTO;
using mendian;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Luna小店.UC.项目成果管理.在制品管理.service
{
    public class 在制品管理Service
    {
        public static List<DTO半成品量尺> get半成品量尺(String styleId)
        {
            return
                FunctionHelper.JsonDeserialization<List<DTO半成品量尺>>(
                    RestCall.httpGetMethod(
                        URL.接口url + "/barcode/getInspectSizeByStyleId?styleId=" + styleId
                        )
                    );
        }
        public static void post半成品量尺检查(String styleId, String inspectSizId)
        {
            RestCall.PostHttp(
                        URL.接口url + "/barcode/inspectSizePassByStyleId?styleId=" + styleId,
                        inspectSizId
                        );
        }

    }
    public class DTO半成品量尺
    {
        public String id { get; set; }//id
        public int index { get; set; }//序号
        public String itemNameCn { get; set; }//大分类名称
        public Double garmentSize { get; set; }//成衣尺寸
        public String parentId { get; set; }//父id
        public Boolean ifPass { get; set; }//是否通过
        public Boolean hasFitValue { get; set; }//是否人尺寸
        public Boolean hasGarmentSize { get; set; }//是否成衣尺寸
        public Boolean hasHalf { get; set; }//是否1/2
        public DTO半成品量尺()
        {

        }
    }

    public class DTO半成品量尺呈现
    {
        public String id { get; set; }//id
        public int index { get; set; }//序号
        public String itemNameCn { get; set; }//大分类名称
        public Double garmentSize { get; set; }//成衣尺寸
        public String parentId { get; set; }//父id
        public String ifPass { get; set; }//是否通过
        public Boolean hasFitValue { get; set; }//是否人尺寸
        public Boolean hasGarmentSize { get; set; }//是否成衣尺寸
        public Boolean hasHalf { get; set; }//是否1/2

        public DTO半成品量尺呈现(DTO半成品量尺 dTO)
        {
            this.id = dTO.id;
            this.index = dTO.index;
            this.itemNameCn = dTO.itemNameCn;
            this.garmentSize = dTO.garmentSize;
            this.parentId = dTO.parentId;
            this.ifPass = dTO.ifPass ? "通过" : "未通过";
            this.hasFitValue = dTO.hasFitValue;
            this.hasGarmentSize = dTO.hasGarmentSize;
            this.hasHalf = dTO.hasHalf;
        }
    }
}
